package com.tencent.wuyanzu.action;

import java.util.ArrayList;

import org.apache.struts2.json.annotations.JSON;
import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ActionSupport;
import com.tencent.wuyanzu.model.Food;
import com.tencent.wuyanzu.service.RecommendService;

public class RecommendAction extends ActionSupport{
	
	@Autowired
	private RecommendService recommendService;
	
	private int uid;
	
	//写不下去了
	
	private int chance;
	private ArrayList<Food> food;
	
	@Override
	public String execute() throws Exception {
		food=recommendService.recommend(uid);
		return super.execute();
	}
	
	@JSON(serialize = false)
	public int getUid() {
		return uid;
	}

	public void setUid(int uid) {
		this.uid = uid;
	}

	@JSON(serialize = true)
	public int getChance() {
		return chance;
	}

	@JSON(serialize = true)
	public ArrayList<Food> getFood() {
		return food;
	}
	
	
}
